package com.fan.controller;

import com.fan.service.CourseService;
import com.fan.utils.CommonResults;
import com.sixth.until.CommonResult;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: self-tui-education
 * @description:
 * @author: 老范
 * @create: 2022-05-09 17:57
 **/
@RestController
@RequestMapping("/order/course")
@Api(tags = "课程详情")
public class CourseController {
    @Autowired
    private CourseService courseService;

    //    根据课程id和会员id查询页面是否是讲师发布的
    @PostMapping("/queryAllById/{id}/{mobile}")
    public CommonResults queryAllById(@PathVariable("id") String id, @PathVariable("mobile") String mobile){
        CommonResults commonResult = courseService.queryAllById(id,mobile);
        return commonResult;
    }

    //    根据课程id和会员id判断当前账号是否为讲师
    @PostMapping("/queryMemberStatus/{id}/{mobile}")
    public CommonResults queryMemberStatus(@PathVariable("id") String id,@PathVariable("mobile") String mobile){
        CommonResults commonResult = courseService.queryMemberStatus(id,mobile);
        return commonResult;
    }
}
